Remove gdk_device_grab/ungrab from the API
authorMatthias Clasen <mclasen@redhat.com>
Wed, 26 Oct 2016 00:03:34 +0000 (20:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 26 Oct 2016 00:03:34 +0000 (20:03 -0400)
These are still used in a few places internally,
so make them private.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdevice.c
gdk/gdkdevice.h
gdk/gdkdeviceprivate.h
gdk/gdkseatdefault.c
gdk/x11/gdkdnd-x11.c

index 4ff47d9719fdc0086ecaa51ff06435b2d14fcf9f..091e1370d293cde0b6f21c85c82b3e56af9356c4 100644 (file)
@@ -698,10 +698,6 @@ gdk_device_get_axes
 gdk_device_warp
 gdk_device_get_seat
 
-<SUBSECTION>
-gdk_device_grab
-gdk_device_ungrab
-
 <SUBSECTION>
 gdk_device_get_state
 gdk_device_get_position
index 13451a5400594016534094a0f3bc12d6f8867140..56080b92c2d5565000fbc4a117076b84a7a5de9c 100644 (file)
@@ -544,7 +544,7 @@ gdk_device_get_property (GObject    *object,
  * Gets the current state of a pointer device relative to @window. As a slave
  * device’s coordinates are those of its master pointer, this
  * function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them. See gdk_device_grab().
+ * unless there is an ongoing grab on them. See gdk_seat_grab().
  */
 void
 gdk_device_get_state (GdkDevice       *device,
@@ -573,7 +573,7 @@ gdk_device_get_state (GdkDevice       *device,
  * Gets the current location of @device in double precision. As a slave device's
  * coordinates are those of its master pointer, this function
  * may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them. See gdk_device_grab().
+ * unless there is an ongoing grab on them. See gdk_seat_grab().
  *
  * Since: 3.10
  **/
@@ -623,7 +623,7 @@ gdk_device_get_position_double (GdkDevice        *device,
  * Gets the current location of @device. As a slave device
  * coordinates are those of its master pointer, This function
  * may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them, see gdk_device_grab().
+ * unless there is an ongoing grab on them, see gdk_seat_grab().
  *
  * Since: 3.0
  **/
@@ -657,7 +657,7 @@ gdk_device_get_position (GdkDevice        *device,
  *
  * As a slave device coordinates are those of its master pointer, This
  * function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them, see gdk_device_grab().
+ * unless there is an ongoing grab on them, see gdk_seat_grab().
  *
  * Returns: (nullable) (transfer none): the #GdkWindow under the
  *   device position, or %NULL.
@@ -707,7 +707,7 @@ gdk_device_get_window_at_position_double (GdkDevice  *device,
  *
  * As a slave device coordinates are those of its master pointer, This
  * function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them, see gdk_device_grab().
+ * unless there is an ongoing grab on them, see gdk_seat_grab().
  *
  * Returns: (nullable) (transfer none): the #GdkWindow under the
  * device position, or %NULL.
@@ -1386,58 +1386,6 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
        GDK_BUTTON3_MOTION_MASK));
 }
 
-/**
- * gdk_device_grab:
- * @device: a #GdkDevice. To get the device you can use gtk_get_current_event_device()
- *   or gdk_event_get_device() if the grab is in reaction to an event. Also, you can use
- *   gdk_device_manager_get_client_pointer() but only in code that isn’t triggered by a
- *   #GdkEvent and there aren’t other means to get a meaningful #GdkDevice to operate on.
- * @window: the #GdkWindow which will own the grab (the grab window)
- * @grab_ownership: specifies the grab ownership.
- * @owner_events: if %FALSE then all device events are reported with respect to
- *                @window and are only reported if selected by @event_mask. If
- *                %TRUE then pointer events for this application are reported
- *                as normal, but pointer events outside this application are
- *                reported with respect to @window and only if selected by
- *                @event_mask. In either mode, unreported events are discarded.
- * @event_mask: specifies the event mask, which is used in accordance with
- *              @owner_events.
- * @cursor: (allow-none): the cursor to display while the grab is active if the device is
- *          a pointer. If this is %NULL then the normal cursors are used for
- *          @window and its descendants, and the cursor for @window is used
- *          elsewhere.
- * @time_: the timestamp of the event which led to this pointer grab. This
- *         usually comes from the #GdkEvent struct, though %GDK_CURRENT_TIME
- *         can be used if the time isn’t known.
- *
- * Grabs the device so that all events coming from this device are passed to
- * this application until the device is ungrabbed with gdk_device_ungrab(),
- * or the window becomes unviewable. This overrides any previous grab on the device
- * by this client.
- *
- * Note that @device and @window need to be on the same display.
- *
- * Device grabs are used for operations which need complete control over the
- * given device events (either pointer or keyboard). For example in GTK+ this
- * is used for Drag and Drop operations, popup menus and such.
- *
- * Note that if the event mask of an X window has selected both button press
- * and button release events, then a button press event will cause an automatic
- * pointer grab until the button is released. X does this automatically since
- * most applications expect to receive button press and release events in pairs.
- * It is equivalent to a pointer grab on the window with @owner_events set to
- * %TRUE.
- *
- * If you set up anything at the time you take the grab that needs to be
- * cleaned up when the grab ends, you should handle the #GdkEventGrabBroken
- * events that are emitted when the grab ends unvoluntarily.
- *
- * Returns: %GDK_GRAB_SUCCESS if the grab was successful.
- *
- * Since: 3.0
- *
- * Deprecated: 3.20. Use gdk_seat_grab() instead.
- **/
 GdkGrabStatus
 gdk_device_grab (GdkDevice        *device,
                  GdkWindow        *window,
@@ -1490,17 +1438,6 @@ gdk_device_grab (GdkDevice        *device,
   return res;
 }
 
-/**
- * gdk_device_ungrab:
- * @device: a #GdkDevice
- * @time_: a timestap (e.g. %GDK_CURRENT_TIME).
- *
- * Release any grab on @device.
- *
- * Since: 3.0
- *
- * Deprecated: 3.20. Use gdk_seat_ungrab() instead.
- */
 void
 gdk_device_ungrab (GdkDevice  *device,
                    guint32     time_)
index c9ca3c6fd836bcde1c74db5db68ae2e0d63f6a26..1fc9a6b0b4e0f7af48c90dba0e228abc3fa48cb0 100644 (file)
@@ -226,19 +226,6 @@ GList *      gdk_device_list_slave_devices    (GdkDevice     *device);
 GDK_AVAILABLE_IN_ALL
 GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
 
-GDK_DEPRECATED_IN_3_20_FOR(gdk_seat_grab)
-GdkGrabStatus gdk_device_grab        (GdkDevice        *device,
-                                      GdkWindow        *window,
-                                      GdkGrabOwnership  grab_ownership,
-                                      gboolean          owner_events,
-                                      GdkEventMask      event_mask,
-                                      GdkCursor        *cursor,
-                                      guint32           time_);
-
-GDK_DEPRECATED_IN_3_20_FOR(gdk_seat_ungrab)
-void          gdk_device_ungrab      (GdkDevice        *device,
-                                      guint32           time_);
-
 GDK_AVAILABLE_IN_ALL
 void          gdk_device_warp        (GdkDevice        *device,
                                       GdkScreen        *screen,
index 22d5097d1264d9c6574e2029eacb2754af2b4eb1..ff84e28c503637e96461df88443a170e2f9ad227 100644 (file)
@@ -193,6 +193,18 @@ void           gdk_device_update_tool (GdkDevice     *device,
 
 GdkInputMode gdk_device_get_input_mode (GdkDevice *device);
 
+GdkGrabStatus gdk_device_grab        (GdkDevice        *device,
+                                      GdkWindow        *window,
+                                      GdkGrabOwnership  grab_ownership,
+                                      gboolean          owner_events,
+                                      GdkEventMask      event_mask,
+                                      GdkCursor        *cursor,
+                                      guint32           time_);
+
+void          gdk_device_ungrab      (GdkDevice        *device,
+                                      guint32           time_);
+
+
 G_END_DECLS
 
 #endif /* __GDK_DEVICE_PRIVATE_H__ */
index dc3f2887d39720e7b34f822aa8744bf2cc1ec471..a9411e238de282cef492619d10d223bc000261f3 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "gdkseatdefaultprivate.h"
+#include "gdkdeviceprivate.h"
 #include "gdkdevicetoolprivate.h"
 
 typedef struct _GdkSeatDefaultPrivate GdkSeatDefaultPrivate;
index 89460744d1ff50aee537f24c1f9c69d50f2f6c47..633fcc6ae054d997b0652675ad46789ec5db0ac7 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "gdkmain.h"
 #include "gdkinternals.h"
+#include "gdkdeviceprivate.h"
 #include "gdkasync.h"
 #include "gdkproperty.h"
 #include "gdkprivate-x11.h"
@@ -2816,15 +2817,11 @@ gdk_x11_drag_context_set_cursor (GdkDragContext *context,
     return;
 
   if (x11_context->grab_seat)
-    {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      gdk_device_grab (gdk_seat_get_pointer (x11_context->grab_seat),
-                       x11_context->ipc_window,
-                       GDK_OWNERSHIP_APPLICATION, FALSE,
-                       GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
-                       cursor, GDK_CURRENT_TIME);
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-    }
+    gdk_device_grab (gdk_seat_get_pointer (x11_context->grab_seat),
+                     x11_context->ipc_window,
+                     GDK_OWNERSHIP_APPLICATION, FALSE,
+                     GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+                     cursor, GDK_CURRENT_TIME);
 }
 
 static void